Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(DHIS2-16133): migrate to new tracker API #1951

Merged
merged 12 commits into from
Mar 6, 2024
Merged

feat(DHIS2-16133): migrate to new tracker API #1951

merged 12 commits into from
Mar 6, 2024

Conversation

kabaros
Copy link
Contributor

@kabaros kabaros commented Nov 3, 2023

This PR updates Tracker Entity and Event import/export to use the new Tracker API as described in the docs here.

implements DHIS2-16133

Changes in this PR

The commit messages should give an overview of the changes, but here are some more details:

  • call the new endpoints: /api/tracker/events and api/tracker/trackedEntities instead of the old api/trackedEntityInstances and api/event
  • use orgUnit instead of ou for defining the organisation unit
  • updates the fetching summary logic to show the report returned by the new scheduler job (used internally by tracker)
    image
  • remove XML for the available formats
  • change atomicMode field to ALL and OBJECT (instead of ALL and NONE in the old API)
  • Remove none from the options for Tracked Entity export filter, as the new API requires choosing either program or tracked entity
  • Tracked Entity import can be done asynchronously now, so we're using the async option same as with other imports.
  • Update UI references from "Tracked Entity Instance" to "Tracked entity"
  • For events, change change startDate and endDate to occuuredBefore and occuredAfter
  • For tracked entities, change lastUpdateStartDate to updatedAfter, lastUpdateEndDate to updatedBefore, and lastUpdatedDuration to updatedWithin
  • For tracked entities, change programStartDate to enrollmentEnrolledAfter (and also endDate)
  • Change followupStatus to followup and ensure that the parameter is not sent if ALL is chosen (the new API expects true or false, or for it not to be provided in the case of ALL)

@dhis2-bot
Copy link
Contributor

dhis2-bot commented Nov 3, 2023

🚀 Deployed on https://pr-1951--dhis2-import-export.netlify.app

@kabaros kabaros force-pushed the api-migration branch 3 times, most recently from afc9135 to 01d94e7 Compare February 23, 2024 14:26
kabaros and others added 11 commits March 5, 2024 13:23
we were assigning setting the state to an event in the new window.
That reference doesn't work one outside the React app in the new window,
so the loader never hides. Not sure if this pattern worked at some point,
but even if it did, it was propbably disabled as a security issue
also change lastUpdateEndDate to updatedBefore, and lastUpdatedDuration to updatedWithin
…rolledAfter

and same for endDate to enrollmentEnrolledBefore
and ensure that the parameter is not selected if ALL is chosen
@kabaros kabaros changed the title chore: migrate to new tracker API feat(DHIS2-16133): migrate to new tracker API Mar 5, 2024
@kabaros kabaros marked this pull request as ready for review March 5, 2024 13:46
@kabaros kabaros requested review from tomzemp and a team and removed request for tomzemp March 5, 2024 13:47
Copy link
Member

@tomzemp tomzemp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove the XML (DXF2) references from the captions,
e.g.
image

image

@kabaros kabaros merged commit da9fbad into master Mar 6, 2024
9 checks passed
@kabaros kabaros deleted the api-migration branch March 6, 2024 11:13
dhis2-bot added a commit that referenced this pull request Mar 6, 2024
# [101.0.0](v100.0.2...v101.0.0) (2024-03-06)

### Features

* **DHIS2-16133:** migrate events and tracker entities to new tracker API ([#1951](#1951)) ([da9fbad](da9fbad))

### BREAKING CHANGES

* **DHIS2-16133:** migrate to new API for tracker import/export. This expects a format incompatible with previous versions.

* fix: loader keeps showing when opening export in new page

we were assigning setting the state to an event in the new window.
That reference doesn't work one outside the React app in the new window,
so the loader never hides. Not sure if this pattern worked at some point,
but even if it did, it was propbably disabled as a security issue

* feat: migrate TEI and Event export to new tracker API

* feat: move Event import to new tracker endpoints

* feat: move TEI import to new tracker endpoints

* refactor: change TEI references to Tracked entity

* fix(migration-events): change start and endDate to occuuredBefore and occuredAfter

* fix(migration-trackedentity): change lastUpdateStartDate to updatedAfter

also change lastUpdateEndDate to updatedBefore, and lastUpdatedDuration to updatedWithin

* fix(migration-trackedentity): change programStateDate to enrollmentEnrolledAfter

and same for endDate to enrollmentEnrolledBefore

* fix(migration-trackedentity): change followupStatus to followup

and ensure that the parameter is not selected if ALL is chosen

* fix: lint issues

* fix: update tests snapshots

* refactor: apply code review comments
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 101.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants